package com.itheima.Jiuye16;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;

public class ClassLoaderDemo {
    public static void main(String[] args) throws IOException {
        //获取系统类加载器
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        InputStream resourceAsStream = systemClassLoader.getResourceAsStream("prop.properties");
        Properties p = new Properties();
        p.load(resourceAsStream);
        System.out.println();
        resourceAsStream.close();

        System.out.println("====================");
        URL resource = systemClassLoader.getResource("prop.properties");
        String path = resource.getPath();
        System.out.println(path);

    }
}
